﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System.Collections;
using System;

namespace Microsoft.WVB.Framework
{
    /// <summary>
    /// Interface supported by any Model aimed at supporting the <see cref="Explorer"/> control.
    /// </summary>
    public interface IExplorerModel
    {
        /// <summary>
        /// Indicates that the <see cref="Explorer"/> control is seeking fro data.
        /// </summary>
        Boolean IsBuffering { get; }

        /// <summary>
        /// An <see cref="IEnumerable"/> of items to be displayed in the User Interface.
        /// </summary>
        /// <remarks>this does not mean that there is no more items to display. 
        /// For this Check the Items internal collection.</remarks>
        IEnumerable DisplayItems { get; }

        /// <summary>
        /// An <see cref="IEnumerable"/> of items to be displayed in the User Interface.
        /// </summary>
        /// <remarks>this does not mean that there is no more items to display. 
        /// For this Check the Items internal collection.</remarks>
        IEnumerable RootCategories { get; }

        /// <summary>
        /// An <see cref="IEnumerable"/> of items to be displayed in the User Interface.
        /// </summary>
        /// <remarks>this does not mean that there is no more items to display. 
        /// For this Check the Items internal collection.</remarks>
        IEnumerable SubCategories { get; }

        /// <summary>
        /// Reset the data to its original result. 
        /// </summary>
        void ResetData();

        /// <summary>
        /// Move from the head category to one level down category(ies).
        /// </summary>
        /// <param name="selection">A <see cref="Category"/> object.</param>
        void DrillDown(object selection);

        /// <summary>
        /// Pages next into the internal <b>items</b> collection.
        /// This influences the DisplayItems collection.
        /// </summary>
        void PageNext();

        /// <summary>
        /// Pages back into the internal <b>items</b> Collection.
        /// This influences the DisplayItems collection.
        /// </summary>
        void PageBack();

        /// <summary>
        /// Filters current selection with some keywords.
        /// This filters the DisplayItems collection in Browse Mode and 
        /// the Items collection in Search Mode.
        /// </summary>
        /// <param name="filter">A <see cref="String"/> providing the keyword to filter against.</param>
        void ApplyFilter(string filter);

        /// <summary>
        /// Searches the Data Service providing keywords
        /// </summary>
        /// <param name="keyword">A <see cref="String"/> providing the keyword to search for.</param>
        void Search(string keyword);

        /// <summary>
        /// Sort Items according the sortCondition.
        /// </summary>
        /// <param name="sortCondition">A <see cref="ExplorerSorting"/> providing the condition to Orderby against.</param>
        void Sort(ExplorerSorting sortCondition);

        /// <summary>
        /// Method available to the Presentation Layer to ask the Model to change the number 
        /// of items in the DisplayItems collection.
        /// </summary>
        /// <param name="number">A <see cref="int"/> informing about the number of items to display.</param>
        void SetItemsNumberToDisplay(int number);
    }
}
